﻿using Stockholm.SOA.Kaskelot.WCF.DataContracts;
using Stockholm.SOA.Kaskelot.WCF.FaultContracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;

namespace Stockholm.SOA.Kaskelot.WCF.ServiceContracts
{
	[ServiceContract(Namespace = "http://stockholm.se/SOA/Kaskelot/KaskelotService/1", Name = "KaskelotService")]
	public interface IKaskelotService
	{
		[OperationContract(Name = "KaskelotGetByggnader")]
		[FaultContract(typeof(ErrorInformation))]
		Byggnad[] GetByggnader(Guid valId);

		[OperationContract(Name = "KaskelotSkickaSMS")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.NotifieringsResultat SkickaSMS(IEnumerable<string> mottagare, string text);

		#region Lookup
		[OperationContract(Name = "KaskelotGetVakansSearchLookupData")]
		[FaultContract(typeof(ErrorInformation))]
		VakansSearchLookupResult GetVakansSearchLookupData(Guid valId);
		#endregion

		#region Val
		[OperationContract(Name = "KaskelotGetVal")]
		[FaultContract(typeof(ErrorInformation))]
		Val GetVal(Guid? id);
		#endregion

		#region Valkrets
		[OperationContract(Name = "KaskelotGetValkrets")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Valkrets GetValkrets(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotGetValkretsar")]
		[FaultContract(typeof(ErrorInformation))]
		Valkrets[] GetValkretsar(Guid valId);

		[OperationContract(Name = "KaskelotCreateValkrets")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateValkrets(DataContracts.Valkrets valkrets);

		[OperationContract(Name = "KaskelotUpdateValkrets")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateValkrets(DataContracts.Valkrets valkrets);

		[OperationContract(Name = "KaskelotDeleteValkrets")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteValkrets(Guid valId, Guid valkretsId);
		#endregion

		#region Församling
		[OperationContract(Name = "KaskelotGetForsamling")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Forsamling GetForsamling(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotCreateForsamling")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateForsamling(DataContracts.Forsamling forsamling);

		[OperationContract(Name = "KaskelotUpdateForsamling")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateForsamling(DataContracts.Forsamling forsamling);

		[OperationContract(Name = "KaskelotDeleteForsamling")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteForsamling(Guid valId, Guid forsamlingId);
		#endregion

		#region Valdistrikt
		[OperationContract(Name = "KaskelotGetValdistrikt")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Valdistrikt GetValdistrikt(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotCreateValdistrikt")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateValdistrikt(DataContracts.Valdistrikt valdistrikt);

		[OperationContract(Name = "KaskelotUpdateValdistrikt")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateValdistrikt(DataContracts.Valdistrikt valdistrikt);

		[OperationContract(Name = "KaskelotDeleteValdistrikt")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteValdistrikt(Guid valId, Guid valdistriktId);

		[OperationContract(Name = "KaskelotGetValdistriktList")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Valdistrikt[] GetValdistriktList(Guid valId, Guid? forsamlingId);

		[OperationContract(Name = "KaskelotGetValdistriktFull")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.ValdistriktFull> GetValdistriktFull(Guid valId, IEnumerable<Guid> idList);

		#endregion

		#region Blankett
		[OperationContract(Name = "KaskelotGetBlankettByName")]
		[FaultContract(typeof(ErrorInformation))]
		Blankett GetBlankettByName(Guid valId, string blankettName);

		[OperationContract(Name = "KaskelotCreateBlankettPost")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateBlankettPost(BlankettPost blankettPost);

		[OperationContract(Name = "KaskelotDeleteBlankettPost")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteBlankettPost(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotUpdateBlankettPost")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateBlankettPost(BlankettPost blankettPost);

		[OperationContract(Name = "KaskelotSetFaltDataForBlankettPost")]
		[FaultContract(typeof(ErrorInformation))]
		void SetFaltDataForBlankettPost(Guid valId, Guid blankettPostId, IEnumerable<DataContracts.FaltData> faltData);

		[OperationContract(Name = "KaskelotGetInkomnaBlankettPoster")]
		[FaultContract(typeof(ErrorInformation))]
		BlankettPost[] GetInkomnaBlankettPoster(Guid valId, string blankett);

		[OperationContract(Name = "KaskelotGetBlankettPost")]
		[FaultContract(typeof(ErrorInformation))]
		BlankettPost GetBlankettPost(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotGetBlankettPostByPerson")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.BlankettPost GetBlankettPostByPerson(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotSkickaEpost")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.NotifieringsResultat SkickaEpost(Guid valId, DataContracts.BlankettPost bp, DataContracts.FaltData[] fd);
		#endregion

		#region Byggnad
		[OperationContract(Name = "KaskelotGetByggnad")]
		[FaultContract(typeof(ErrorInformation))]
		Byggnad GetByggnad(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotGetByggnadList")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<ByggnadFull> GetByggnadList(Guid valId, IEnumerable<Guid> idList);

		[OperationContract(Name = "KaskelotUpdateByggnad")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateByggnad(DataContracts.Byggnad byggnad);

		[OperationContract(Name = "KaskelotCreateByggnad")]
		[FaultContract(typeof(ErrorInformation))]
		Guid CreateByggnad(DataContracts.Byggnad byggnad);

		[OperationContract(Name = "KaskelotDeleteByggnad")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteByggnad(DataContracts.Byggnad byggnad);

		[OperationContract(Name = "KaskelotGetKontaktPersonListByByggnad")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.GetKontaktpersonListByByggnadView[] GetKontaktPersonListByByggnad(Guid valId, Guid byggnadId);

		[OperationContract(Name = "KaskelotAddKontaktpersonToByggnad")]
		[FaultContract(typeof(ErrorInformation))]
		void AddKontaktpersonToByggnad(PersonByggnad pb);

		[OperationContract(Name = "KaskelotRemoveKontaktpersonFromByggnad")]
		[FaultContract(typeof(ErrorInformation))]
		void RemoveKontaktpersonFromByggnad(Guid valId, Guid person, Guid byggnad);

		[OperationContract(Name = "KaskelotGetByggnadListByKontaktpersonId")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Byggnad[] GetByggnadListByKontaktpersonId(Guid valId, Guid kontaktpersonId);
		#endregion

		#region ByggnadSearch
		[OperationContract(Name = "KaskelotGetByggnadSearchLookupData")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.ByggnadSearchLookupResult GetByggnadSearchLookupData(Guid valId);

		[OperationContract(Name = "KaskelotGetForsamlingar")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Forsamling[] GetForsamlingar(Guid valId, Guid? valkretsId);

		[OperationContract(Name = "KaskelotSearchByggnader")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.ByggnadSearchResult[] SearchByggnader(Guid valId, DataContracts.ByggnadSearchParameters parameters);
		#endregion

		#region Skyltar
		[OperationContract(Name = "KaskelotGetSkyltListByByggnad")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Skylt[] GetSkyltListByByggnad(Guid valId, Guid byggnadId);

		[OperationContract(Name = "KaskelotGetSkylt")]
		[FaultContract(typeof(ErrorInformation))]
		Skylt GetSkylt(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotUpdateSkylt")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateSkylt(Skylt materiel);

		[OperationContract(Name = "KaskelotDeleteSkylt")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteSkylt(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotCreateSkylt")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateSkylt(Skylt skylt);
		#endregion

		#region Materiel
		[OperationContract(Name = "KaskelotGetMaterielListByByggnad")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.GetMaterielListByByggnadView[] GetMaterielListByByggnad(Guid valId, Guid byggnadId);

		[OperationContract(Name = "KaskelotGetMateriel")]
		[FaultContract(typeof(ErrorInformation))]
		Materiel GetMateriel(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotUpdateMateriel")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateMateriel(Materiel materiel);

		[OperationContract(Name = "KaskelotDeleteMateriel")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteMateriel(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotCreateMateriel")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateMateriel(Materiel materiel);
		#endregion

		#region MaterielTyp
		[OperationContract(Name = "KaskelotGetMaterielTypLookupData")]
		[FaultContract(typeof(ErrorInformation))]
		MaterielTyp[] GetMaterielTypLookupData(Guid valId);

		[OperationContract(Name = "KaskelotGetPublicMaterielTypList")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.MaterielTyp[] GetPublicMaterielTypList(Guid valId);

		[OperationContract(Name = "KaskelotGetMaterielTypList")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.MaterielTyp[] GetMaterielTypList(Guid valId);

		[OperationContract(Name = "KaskelotGetMaterielTyp")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.MaterielTyp GetMaterielTyp(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotUpdateMaterielTyp")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateMaterielTyp(MaterielTyp mt);

		[OperationContract(Name = "KaskelotCreateMaterielTyp")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateMaterielTyp(MaterielTyp mt);

		[OperationContract(Name = "KaskelotDeleteMaterielTyp")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteMaterielTyp(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotSetUnderliggandeMaterielTyp")]
		[FaultContract(typeof(ErrorInformation))]
		void SetUnderliggandeMaterielTyperForMaterielTyp(Guid valId, Guid parentId, IEnumerable<DataContracts.MaterielTypMaterielTyp> underliggandeTyper);

		[OperationContract(Name = "KaskelotGetUnderliggandeMaterielTyp")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.MaterielTyp[] GetUnderliggandeMaterielTyperForMaterielTyp(Guid valId, Guid parentId);
		#endregion

		#region PersonSearch
		[OperationContract(Name = "KaskelotGetPersonSearchLookupData")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.PersonSearchLookupResult GetPersonSearchLookupData(Guid valId);

		[OperationContract(Name = "KaskelotSearchPersoner")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.PersonSearchResult[] SearchPersoner(Guid valId, DataContracts.PersonSearchParameters parameters);
		#endregion

		#region Person
		[OperationContract(Name = "KaskelotGetPerson")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Person GetPerson(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotGetPersonByPersonnummer")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Person GetPersonByPersonnummer(Guid valId, string personnummer);

		[OperationContract(Name = "KaskelotGetPersonByEmail")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Person GetPersonByEmail(Guid valId, string email);

		[OperationContract(Name = "KaskelotUpdatePerson")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdatePerson(DataContracts.Person person);

		[OperationContract(Name = "KaskelotCreatePerson")]
		[FaultContract(typeof(ErrorInformation))]
		Guid CreatePerson(DataContracts.Person person);

		[OperationContract(Name = "KaskelotGetPersonList")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.PersonFull> GetPersonList(Guid valId, IEnumerable<Guid> idList);

		[OperationContract(Name = "KaskelotCreatePersonPersonTyp")]
		[FaultContract(typeof(ErrorInformation))]
		void CreatePersonPersonTyp(Guid valId, Guid personId, Guid persontypId);

		[OperationContract(Name = "KaskelotUpdatePersonList")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdatePersonList(Guid valId, IEnumerable<DataContracts.Person> personer);

		[OperationContract(Name = "KaskelotGetPersonListByPersonnummer")]
		[FaultContract(typeof(ErrorInformation))]
		IList<DataContracts.Person> GetPersonListByPersonnummer(Guid valId, IEnumerable<string> personnummer);
		#endregion

		#region PersonHändelseLogg
		[OperationContract(Name = "KaskelotGetPersonHandelseLoggTodo")]
		[FaultContract(typeof(ErrorInformation))]
		PersonHandelseLogg[] GetPersonHandelseLoggTodo(Guid valId);

		[OperationContract(Name = "KaskelotUpdatePersonHandelseLogg")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdatePersonHandelseLogg(PersonHandelseLogg phl);

		[OperationContract(Name = "KaskelotCreatePersonHandelseLogg")]
		[FaultContract(typeof(ErrorInformation))]
		void CreatePersonHandelseLogg(PersonHandelseLogg phl);

		[OperationContract(Name = "KaskelotDeletePersonHandelseLogg")]
		[FaultContract(typeof(ErrorInformation))]
		void DeletePersonHandelseLogg(Guid valId, Guid id);

		[OperationContract(Name = "kaskelotGetPersonHandelseLoggByPersonId")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.PersonHandelseLogg[] GetPersonHandelseLoggByPersonId(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotGetPersonHandelseLogg")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.PersonHandelseLogg GetPersonHandelseLogg(Guid valId, Guid id);
		#endregion

		#region ByggnadHändelseLogg
		[OperationContract(Name = "KaskelotGetByggnadHandelseLoggTodo")]
		[FaultContract(typeof(ErrorInformation))]
		ByggnadHandelseLogg[] GetByggnadHandelseLoggTodo(Guid valId);

		[OperationContract(Name = "KaskelotGetByggnadHandelseLogg")]
		[FaultContract(typeof(ErrorInformation))]
		ByggnadHandelseLogg GetByggnadHandelseLogg(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotUpdateByggnadHandelseLogg")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateByggnadHandelseLogg(ByggnadHandelseLogg bhl);

		[OperationContract(Name = "KaskelotDeleteByggnadHandelseLogg")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteByggnadHandelseLogg(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotCreateByggnadHandelseLogg")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateByggnadHandelseLogg(ByggnadHandelseLogg bhl);

		[OperationContract(Name = "KaskelotGetByggnadHandelseLoggByByggnadId")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.ByggnadHandelseLogg[] GetByggnadHandelseLoggByByggnadId(Guid valId, Guid id);
		#endregion

		#region Lokal
		[OperationContract(Name = "KaskelotGetLokal")]
		[FaultContract(typeof(ErrorInformation))]
		Lokal GetLokal(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotUpdateLokal")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateLokal(Lokal lokal);

		[OperationContract(Name = "KaskelotDeleteLokal")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteLokal(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotCreateLokal")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateLokal(Lokal lokal);

		[OperationContract(Name = "KaskelotGetLokalListByByggnad")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.GetLokalListByByggnadView[] GetLokalListByByggnad(Guid valId, Guid id);
		#endregion

		#region Funktion
		[OperationContract(Name = "KaskelotGetFunktion")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Funktion GetFunktion(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotGetFunktioner")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Funktion[] GetFunktioner(Guid valId);

		[OperationContract(Name = "KaskelotCreateFunktion")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateFunktion(DataContracts.Funktion funktion);

		[OperationContract(Name = "KaskelotUpdateFunktion")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateFunktion(DataContracts.Funktion funktion);

		[OperationContract(Name = "KaskelotDeleteFunktion")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteFunktion(Guid valId, Guid funktionId);
		#endregion

		#region Bemanning - Vakans
		[OperationContract(Name = "KaskelotBemannaVakans")]
		[FaultContract(typeof(ErrorInformation))]
		void BemannaVakans(Guid valId, Guid vakansId, Guid personId, bool removeExisting);
		#endregion

		#region Bemanning - Sökningar
		[OperationContract(Name = "KaskelotVakansSearch")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<VakansSearchResult> VakansSearch(Guid valId, VakansSearchParameters vsp);

		[OperationContract(Name = "KaskelotValdistriktSearch")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<ValdistriktSearchResult> ValdistriktSearch(Guid valId, ValdistriktSearchParameters vsp);

		[OperationContract(Name = "KaskelotGruppSearch")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<Grupp> GruppSearch(Guid valId, Guid? kursTillfalleId);

		[OperationContract(Name = "KaskelotBemanningSearchPersoner")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.PersonSearchResult> BemanningSearchPersoner(Guid valId, DataContracts.PersonSearchParameters parameters);
		#endregion

		#region Bemanning - Valdistrikt
		[OperationContract(Name = "KaskelotGetBemanningValdistrikt")]
		[FaultContract(typeof(ErrorInformation))]
		BemanningValdistrikt GetBemanningValdistrikt(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotUpdateBemanningValdistrikt")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateBemanningValdistrikt(BemanningValdistrikt bg);

		[OperationContract(Name = "KaskelotGetValdistriktDetails")]
		[FaultContract(typeof(ErrorInformation))]
		ValdistriktDetailsView GetValdistriktDetails(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotRemovePersonFromBemanningValdistrikt")]
		[FaultContract(typeof(ErrorInformation))]
		void RemovePersonFromBemanningValdistrikt(Guid valId, Guid bemanningId);

		[OperationContract(Name = "KaskelotDeleteBemanningValdistrikt")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteBemanningValdistrikt(Guid valId, Guid bemanningId);

		[OperationContract(Name = "KaskelotCreateBemanningValdistrikt")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateBemanningValdistrikt(BemanningValdistrikt bv);
		#endregion

		#region Bemanning - Grupp
		[OperationContract(Name = "KaskelotGetBemanningGrupp")]
		[FaultContract(typeof(ErrorInformation))]
		BemanningGrupp GetBemanningGrupp(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotUpdateBemanningGrupp")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateBemanningGrupp(BemanningGrupp bg);

		[OperationContract(Name = "KaskelotGetGruppDetails")]
		[FaultContract(typeof(ErrorInformation))]
		GruppDetailsView GetGruppDetails(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotRemovePersonFromBemanningGrupp")]
		[FaultContract(typeof(ErrorInformation))]
		void RemovePersonFromBemanningGrupp(Guid valId, Guid bemanningId);

		[OperationContract(Name = "KaskelotDeleteBemanningGrupp")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteBemanningGrupp(Guid valId, Guid bemanningId);

		[OperationContract(Name = "KaskelotCreateBemanningGrupp")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateBemanningGrupp(BemanningGrupp bv);
		#endregion

		#region Bemanning - Historik
		[OperationContract(Name = "KaskelotGetBemanningGruppByPersonId")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.BemanningGrupp> GetBemanningGruppByPersonId(Guid id);

		[OperationContract(Name = "KaskelotGetBemanningValdistriktByPersonId")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.BemanningValdistrikt> GetBemanningValdistriktByPersonId(Guid id);
		#endregion

		#region Administration - Grupp
		[OperationContract(Name = "KaskelotGetGrupp")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Grupp GetGrupp(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotCreateGrupp")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateGrupp(DataContracts.Grupp grupp);

		[OperationContract(Name = "KaskelotUpdateGrupp")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateGrupp(DataContracts.Grupp grupp);

		[OperationContract(Name = "KaskelotDeleteGrupp")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteGrupp(Guid valId, Guid id);
		#endregion

		#region Administration - PersonTyp
		[OperationContract(Name = "KaskelotGetPersonTyper")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.PersonTyp> GetPersonTyper(Guid valId);

		[OperationContract(Name = "KaskelotGetPersonTyp")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.PersonTyp GetPersonTyp(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotCreatePersonTyp")]
		[FaultContract(typeof(ErrorInformation))]
		void CreatePersonTyp(DataContracts.PersonTyp PersonTyp);

		[OperationContract(Name = "KaskelotUpdatePersonTyp")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdatePersonTyp(DataContracts.PersonTyp PersonTyp);

		[OperationContract(Name = "KaskelotDeletePersonTyp")]
		[FaultContract(typeof(ErrorInformation))]
		void DeletePersonTyp(Guid valId, Guid id);
		#endregion

		#region Administration - ByggnadTyp
		[OperationContract(Name = "KaskelotGetByggnadTyper")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.ByggnadTyp> GetByggnadTyper(Guid valId);

		[OperationContract(Name = "KaskelotGetByggnadTyp")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.ByggnadTyp GetByggnadTyp(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotCreateByggnadTyp")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateByggnadTyp(DataContracts.ByggnadTyp ByggnadTyp);

		[OperationContract(Name = "KaskelotUpdateByggnadTyp")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateByggnadTyp(DataContracts.ByggnadTyp ByggnadTyp);

		[OperationContract(Name = "KaskelotDeleteByggnadTyp")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteByggnadTyp(Guid valId, Guid id);
		#endregion

		#region Administration - Stadsdel
		[OperationContract(Name = "KaskelotGetStadsdeler")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.Stadsdel> GetStadsdelar(Guid valId);

		[OperationContract(Name = "KaskelotGetStadsdel")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Stadsdel GetStadsdel(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotCreateStadsdel")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateStadsdel(DataContracts.Stadsdel stadsdel);

		[OperationContract(Name = "KaskelotUpdateStadsdel")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateStadsdel(DataContracts.Stadsdel stadsdel);

		[OperationContract(Name = "KaskelotDeleteStadsdel")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteStadsdel(Guid valId, Guid id);
		#endregion

		#region Administration - Val
		[OperationContract(Name = "KaskelotGetValer")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.Val> GetAllVal();

		[OperationContract(Name = "KaskelotCreateVal")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateVal(Val v, Guid previousValId);

		[OperationContract(Name = "KaskelotUpdateVal")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateVal(DataContracts.Val Val);
		#endregion

		#region Administration - Blankett
		[OperationContract(Name = "KaskelotGetBlanketter")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.Blankett> GetBlanketter(Guid valId);

		[OperationContract(Name = "KaskelotGetBlankett")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Blankett GetBlankett(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotCreateBlankett")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateBlankett(DataContracts.Blankett Blankett);

		[OperationContract(Name = "KaskelotUpdateBlankett")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateBlankett(DataContracts.Blankett Blankett);

		[OperationContract(Name = "KaskelotDeleteBlankett")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteBlankett(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotSetFaltForBlankett")]
		[FaultContract(typeof(ErrorInformation))]
		void SetFaltForBlankett(Guid valId, Guid parentId, IEnumerable<DataContracts.BlankettFalt> blankettFalt);

		[OperationContract(Name = "KaskelotGetFaltForBlankett")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Falt[] GetFaltForBlankett(Guid valId, Guid parentId);

		#endregion

		#region Administration - Falt
		[OperationContract(Name = "KaskelotGetAllaFalt")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.Falt> GetAllaFalt(Guid valId);

		[OperationContract(Name = "KaskelotGetFalt")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Falt GetFalt(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotCreateFalt")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateFalt(DataContracts.Falt Falt);

		[OperationContract(Name = "KaskelotUpdateFalt")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateFalt(DataContracts.Falt Falt);

		[OperationContract(Name = "KaskelotDeleteFalt")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteFalt(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotSetFaltAlternativForFalt")]
		[FaultContract(typeof(ErrorInformation))]
		void SetFaltAlternativForFalt(Guid valId, Guid faltId, IEnumerable<DataContracts.FaltAlternativ> faltAlternativ);

		[OperationContract(Name = "KaskelotGetFaltAlternativForFalt")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.FaltAlternativ[] GetFaltAlternativForFalt(Guid valId, Guid faltId);
		#endregion

		#region Analys
		[OperationContract(Name = "KaskelotExecuteQuery")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Analys.QueryResult ExecuteQuery(DataContracts.Analys.Query query, Guid valId);

		[OperationContract(Name = "KaskelotGetEntities")]
		[FaultContract(typeof(ErrorInformation))]
		List<DataContracts.Analys.Entity> GetEntities();

		[OperationContract(Name = "KaskelotGetLookupInformation")]
		[FaultContract(typeof(ErrorInformation))]
		List<DataContracts.Analys.LookupField> GetLookupInformation();

		[ServiceKnownType(typeof(DataContracts.Analys.FieldFilter))]
		[ServiceKnownType(typeof(DataContracts.Analys.FilterGroup))]
		[OperationContract(Name = "KaskelotGetQueriesByPerson")]
		[FaultContract(typeof(ErrorInformation))]
		List<DataContracts.Analys.Query> GetQueriesByPerson(string loginName);

		[ServiceKnownType(typeof(DataContracts.Analys.FieldFilter))]
		[ServiceKnownType(typeof(DataContracts.Analys.FilterGroup))]
		[OperationContract(Name = "KaskelotSaveQuery")]
		[FaultContract(typeof(ErrorInformation))]
		void SaveQuery(DataContracts.Analys.Query query, string loginName);

		[ServiceKnownType(typeof(DataContracts.Analys.FieldFilter))]
		[ServiceKnownType(typeof(DataContracts.Analys.FilterGroup))]
		[OperationContract(Name = "KaskelotGetQueryById")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Analys.Query GetQueryById(int id);

		[OperationContract(Name = "KaskelotDeleteQuery")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteQuery(int id);
		#endregion

		#region Extern web
		[OperationContract(Name = "KaskelotGetValdistriktDetailsByPersonId")]
		[FaultContract(typeof(ErrorInformation))]
		ValdistriktDetailsView GetValdistriktDetailsByPersonId(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotGetGruppDetailsByPersonId")]
		[FaultContract(typeof(ErrorInformation))]
		GruppDetailsView GetGruppDetailsByPersonId(Guid valId, Guid id);
		#endregion

		#region Kurser
		[OperationContract(Name = "KaskelotGetKurser")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Kurs[] GetKurser(Guid valId);

		[OperationContract(Name = "KaskelotGetKurs")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.Kurs GetKurs(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotUpdateKurs")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateKurs(DataContracts.Kurs kurs);

		[OperationContract(Name = "KaskelotCreateKurs")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateKurs(DataContracts.Kurs kurs);

		[OperationContract(Name = "KaskelotDeleteKurs")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteKurs(Guid valId, Guid id);
		#endregion

		#region KursTillfälle
		[OperationContract(Name = "KaskelotGetKursTillfalleByKursId")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.KursTillfalle[] GetKursTillfallenByKursId(Guid valId, Guid? KursId);

		[OperationContract(Name = "KaskelotGetKurstillfalle")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.KursTillfalle GetKurstillfalle(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotUpdateKurstillfalle")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdateKurstillfalle(DataContracts.KursTillfalle kurstillfalle);

		[OperationContract(Name = "KaskelotCreateKurstillfalle")]
		[FaultContract(typeof(ErrorInformation))]
		void CreateKurstillfalle(DataContracts.KursTillfalle kurstillfalle);

		[OperationContract(Name = "KaskelotDeleteKurstillfalle")]
		[FaultContract(typeof(ErrorInformation))]
		void DeleteKurstillfalle(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotGetKursTillfalleByPersonId")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.KursTillfalle> GetKursTillfalleByPersonId(Guid valId, Guid id);
		#endregion

		#region PersonKursTillfalle
		[OperationContract(Name = "KaskelotAddPersonKursTillfalle")]
		[FaultContract(typeof(ErrorInformation))]
		void AddPersonKursTillfalle(Guid valId, Guid kurstillfalleId, int antal, string skapadAv);

		[OperationContract(Name = "KaskelotGetPersonKursTillfalleByKursTillfalleId")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.PersonKursTillfalle[] GetPersonKursTillfallenByKursTillfalleId(Guid valId, Guid kurstillfalleId);

		[OperationContract(Name = "KaskelotDeletePersonKursTillfalle")]
		[FaultContract(typeof(ErrorInformation))]
		void DeletePersonKursTillfalle(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotGetPersonKursTillfalle")]
		[FaultContract(typeof(ErrorInformation))]
		DataContracts.PersonKursTillfalle GetPersonKursTillfalle(Guid valId, Guid id);

		[OperationContract(Name = "KaskelotUpdatePersonKursTillfalle")]
		[FaultContract(typeof(ErrorInformation))]
		void UpdatePersonKursTillfalle(DataContracts.PersonKursTillfalle personkurstillfalle);

		[OperationContract(Name = "KaskelotPlaceraValdistriktTillKursTillfalle")]
		[FaultContract(typeof(ErrorInformation))]
		void PlaceraValdistriktTillKursTillfalle(Guid valId, Guid valdistriktId, Guid kurstillfalleId);

		[OperationContract(Name = "KaskelotPlaceraGruppTillKursTillfalle")]
		[FaultContract(typeof(ErrorInformation))]
		void PlaceraGruppTillKursTillfalle(Guid valId, Guid gruppId, Guid kurstillfalleId);
		#endregion

		#region Integrationer
		[OperationContract(Name = "KaskelotGetPersonnummerList")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<string> GetPersonnummerList(Guid valId);

		[OperationContract(Name = "KaskelotGetLokalData")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.Lokal> GetLokalData(Guid valId);

		[OperationContract(Name = "KaskelotGetPersonData")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.PersonData> GetPersonData(Guid valId);

		[OperationContract(Name = "KaskelotGetPersonDataIntegration")]
		[FaultContract(typeof(ErrorInformation))]
		IEnumerable<DataContracts.PersonData> GetPersonDataIntegration(Guid valId);
		#endregion
	}
}
